<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>main.c</title>
<style type="text/css">
<!--
body.hl	{ background-color:#ffffff; }
pre.hl	{ color:#000000; background-color:#ffffff; font-size:10pt; font-family:'Courier New';}
.hl.num { color:#ff0000; }
.hl.esc { color:#ff22ff; }
.hl.str { color:#ff0000; }
.hl.dstr { color:#ff0000; }
.hl.slc { color:#0000ff; }
.hl.com { color:#0000ff; }
.hl.dir { color:#ff22ff; }
.hl.sym { color:#000000; }
.hl.line { color:#0000ff; }
.hl.mark	{ background-color:#ffffbb;}
.hl.kwa { color:#b26818; }
.hl.kwb { color:#00ff00; }
.hl.kwc { color:#b26818; }
.hl.kwd { color:#000000; }
//-->
</style>
</head>
<body class="hl">
<pre class="hl"><span class="hl dir">#include</span> <span class="hl dstr">&quot;scheme.h&quot;</span><span class="hl dir"></span>

<span class="hl kwb">int</span> <span class="hl kwd">main</span> <span class="hl sym">(</span><span class="hl kwb">int</span> argc<span class="hl sym">,</span> <span class="hl kwb">const char</span> <span class="hl sym">*</span> argv<span class="hl sym">[]) {</span>
    Pair <span class="hl sym">*</span>e<span class="hl sym">;</span> <span class="hl com">/* expression */</span>
    Pair <span class="hl sym">*</span>v<span class="hl sym">;</span> <span class="hl com">/* value - we hope */</span>

    <span class="hl kwd">init</span><span class="hl sym">();</span>
    yyin <span class="hl sym">=</span> <span class="hl kwd">fopen</span><span class="hl sym">(</span> argv<span class="hl sym">[</span><span class="hl num">1</span><span class="hl sym">],</span> <span class="hl str">&quot;r&quot;</span> <span class="hl sym">);</span>

    <span class="hl com">/* begining of read-eval-print loop */</span>
    <span class="hl kwa">while</span> <span class="hl sym">( (</span>e <span class="hl sym">=</span> <span class="hl kwd">readexp</span><span class="hl sym">()) != (</span>Pair <span class="hl sym">*)</span> EOF <span class="hl sym">)</span>
    <span class="hl sym">{</span>
        <span class="hl kwd">pexp</span><span class="hl sym">(</span> e <span class="hl sym">);</span>
        <span class="hl kwd">printf</span><span class="hl sym">(</span> <span class="hl str">&quot;value is: &quot;</span> <span class="hl sym">);</span>
        v <span class="hl sym">=</span> <span class="hl kwd">eval</span><span class="hl sym">(</span> e<span class="hl sym">,</span> env0 <span class="hl sym">);</span>
        <span class="hl kwd">pexp</span><span class="hl sym">(</span> v <span class="hl sym">);</span>
    <span class="hl sym">}</span>
    <span class="hl kwa">return</span> <span class="hl num">0</span><span class="hl sym">;</span>
<span class="hl sym">}</span>
</pre>
</body>
</html>
<!--HTML generated by highlight 2.6.14, http://www.andre-simon.de/-->
